Source: fivethirtyeight
AKA “Please just don’t make me point-and-click 100 charts”
Source: Hadley Wickham
Source: ggplot2
In the first edition of @FT's World Cup Extra series of stats-y briefings, @muradahmed and I ask: as curtain-raisers go, just how underwhelming is Russia vs Saudi Arabia?https://t.co/0aQXcaD9YV pic.twitter.com/GOXVyVlRW7
— John Burn-Murdoch (@jburnmurdoch) June 13, 2018
Source: Hadley Wickham
| name | year | category | lat | long | wind | pressure |
|---|---|---|---|---|---|---|
| Kate | 2015 | 0 | 29.5 | -75.4 | 60 | 998 |
| Erin | 1989 | 0 | 20.6 | -38.3 | 40 | 1001 |
| Ana | 1985 | 0 | 34.4 | -67.3 | 40 | 1007 |
| Danielle | 1986 | 0 | 11.8 | -57.5 | 45 | 1000 |
| Gordon | 1994 | 0 | 17.5 | -79.8 | 40 | 999 |
| Gaston | 2004 | -1 | 31.4 | -78.0 | 30 | 1011 |
| Dean | 1995 | -1 | 33.0 | -98.5 | 20 | 1004 |
| Arthur | 1984 | -1 | 18.2 | -61.2 | 25 | 1010 |
| Amy | 1975 | 0 | 37.3 | -64.1 | 60 | 986 |
| Leslie | 2012 | 0 | 33.8 | -62.0 | 55 | 988 |
ggplot(data = )
aes(x = , y = , color = )
X or Y
Color or Fill
Size
Shape
Others: transparency, animations, faceting
Plots are often called their geometric object(s).
geom_bar() or geom_col()
geom_line()
geom_point()
?
Path of Hurricane Katrina
Before
scale_x_continuous()
After
scale_x_log10()
Before
scale_size_continuous(breaks = c(25, 75, 125))
After
scale_size_continuous(range = c(0.5, 20), breaks = c(25, 75, 125))
coord_polar()
Facet wrap
facet_wrap(~category)
Facet grid
facet_grid(month~status)
Count
Default theme
fivethirtyeight theme
urbnthemes
Source: Policyviz by Jon Schwabish
Animation
By Sarah Strochak
3.2, 4.2, 4.3, 4.7, 5.12
A
B
Once you understand ggplot2, it is really useful for doing 90% of the results with 10% of the effort
(Jennfer Hill)
A+
B+
A+